<template>
    <div>
        <h3>搜索组件</h3>
        搜索：<input type="text" name="search" id="search" v-model="search">
    </div>
</template>
<script>
export default {
    data() {
        return {
            search: ""
        }
    },
    watch: {
        search(newVal, oldVal) {
            this.$emit("searchEvent", newVal)
        }
    }
}
</script>
